<template>
  <div>
    <h1>modifyaInsuranceType</h1>
  <el-form :inline="true" :model="modifyatype" >
    <el-form-item label="modifyainsurancetype">
      <el-input v-model="modifyatype.name" placeholder="modifyainsurancetype"></el-input>
    </el-form-item>
   
    <el-form-item>
      <el-button type="primary" @click='sure' >modifya</el-button>
      
    </el-form-item>
  </el-form>
 
 </div>
</template>
</template>

<script>
import {createNamespacedHelpers} from 'vuex';
const { mapActions } = createNamespacedHelpers('insurancetype')
export default {
    data(){
        return{
            modifyatype:{
                _id:'',
                name:''
            }
        }
    },
    async created(){
        const data = await this.getUpInsurances(this.$route.params._id)
        this.modifyatype = data.data[0]
        
    },
    methods:{
        ...mapActions(['getUpInsurances']),
        ...mapActions(['sureUpInsurance']),
        sure(){
             this.sureUpInsurance(this.modifyatype);
             this.$router.push('/insurancelist');
        }
    }
}
</script>

<style>

</style>